from app.libs.error import APIException


class Success(APIException):
    code = 201
    message = 'OK'
    error_code = 0


class DeleteSuccess(Success):
    code = 202
    error_code = 1


class ClientTypeError(APIException):
    code = 400
    message = 'client type error'
    error_code = 1006


class ClientPostError(APIException):
    code = 400
    message = 'client post error'
    error_code = 1007


class ParameterException(APIException):
    code = 400
    message = 'invalid paramete'
    error_code = 1000


class ServerError(APIException):
    pass


class NotFound(APIException):
    code = 404
    message = 'not found'
    error_code = 1001


class AuthFailed(APIException):
    code = 401
    error_code = 1005
    message = 'authorization faild。用户授权失败'


class Forbidden(APIException):
    code = 403
    error_code = 1004
    message = 'forbidden, not in scope'


class DuplicateGift(APIException):
    code = 400
    error_code = 2001
    message = '想要的书你已经添加了'